package com.huangsm.book.designmodel;

/**
 * 具体的装饰器，负责对核心发布的内容进行HTML格式化操作。
 * @author huang
 * @PACKAGE_NAME com.huangsm.book.designmodel
 * @PROJECT_NAME concurrence
 * @date 2019/2/15
 */
public class PacketHTMLHeaderCreator extends PacketDecorator{
    public PacketHTMLHeaderCreator(IPacketCreator c){
        super(c);
    }
    @Override
    public String handleContent() {//将给定数据封装成HTML
        StringBuffer sb=new StringBuffer();
        sb.append("<html>");
        sb.append("<body>");
        //发布的内容
        sb.append(component.handleContent());
        sb.append("</body>");
        sb.append("</html>\n");
        return sb.toString();
    }
}
